package cn.yuanqiao.activiti.listener;

import cn.yuanqiao.archive.Identify.service.BgqxLcIdentifyService;
import cn.yuanqiao.common.exception.activiti.ArchiveProcessException;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @ClassName: ArchiveBgqxIdentifyHnNotAgreeListener
 * @Description: 保管期限不同意监听（海南）
 * @author: lihuahua
 * @date: 2023/12/5 19:24
 * @Blog: huahuacoco.top
 */

@Component("ArchiveBgqxIdentifyHnNotAgreeListener")
public class ArchiveBgqxIdentifyHnNotAgreeListener implements ExecutionListener {

    @Autowired
    private BgqxLcIdentifyService mjIdentifyService;



    @Override
    public void notify(DelegateExecution execution) {

        String identifyId = String.valueOf(execution.getVariable("identifyId"));

        if (identifyId == null || "".equals(identifyId)){
            throw new ArchiveProcessException("保管期限鉴定单Id不能为空");
        }
        mjIdentifyService.disagreeBgqxType(identifyId);
        System.out.println("不同意保管期限鉴定，修改数据");

    }
}
